{"ast":null,"code":"import _slicedToArray from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React from\"react\";import{ToggleItem}from\"../index\";import{svgProfile,svgDialogs,svgContact,svgExit,svgPlus}from\"../../assets\";import{Context}from\"../../index\";import{browserRouteHome}from\"../../routes\";import classNames from\"classnames\";import'./Toggle.scss';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var Toggle=function Toggle(){var _React$useContext=React.useContext(Context),store=_React$useContext.store;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),status=_React$useState2[0],setStatus=_React$useState2[1];return/*#__PURE__*/_jsxs(\"div\",{className:\"toggle__sidebar\",children:[/*#__PURE__*/_jsx(\"button\",{className:classNames(\"toggle__sidebar__switch\",{\"toggle__sidebar__switch--status\":status}),onClick:function onClick(){return setStatus(!status);},style:{backgroundImage:\"url(\".concat(svgPlus,\")\")}}),status&&/*#__PURE__*/_jsxs(\"div\",{className:\"toggle__sidebar-container\",children:[/*#__PURE__*/_jsx(ToggleItem,{name:'Профиль',svgUrl:svgProfile}),/*#__PURE__*/_jsx(ToggleItem,{name:'Диалоги',svgUrl:svgDialogs,link:browserRouteHome}),/*#__PURE__*/_jsx(ToggleItem,{name:'Контакты',svgUrl:svgContact}),/*#__PURE__*/_jsx(ToggleItem,{name:'Выйти',svgUrl:svgExit,onClick:function onClick(){return store.logout();}})]})]});};export default Toggle;","map":{"version":3,"names":["React","ToggleItem","svgProfile","svgDialogs","svgContact","svgExit","svgPlus","Context","browserRouteHome","classNames","Toggle","useContext","store","useState","status","setStatus","backgroundImage","logout"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/components/Toggle/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {ToggleItem} from \"../index\";\nimport {svgProfile, svgDialogs, svgContact, svgExit, svgPlus} from \"../../assets\";\nimport {Context} from \"../../index\";\nimport {browserRouteHome} from \"../../routes\";\nimport classNames from \"classnames\";\nimport './Toggle.scss';\n\nconst Toggle = () => {\n    const {store} = React.useContext(Context);\n    const [status, setStatus] = React.useState<boolean>(false);\n\n    return (\n        <div className=\"toggle__sidebar\">\n            <button className={classNames(\"toggle__sidebar__switch\",\n                {\"toggle__sidebar__switch--status\": status})}\n                    onClick={() => setStatus(!status)}\n                    style={{backgroundImage: `url(${svgPlus})`}}\n            />\n            {(status &&\n                <div className=\"toggle__sidebar-container\">\n                    <ToggleItem name={'Профиль'} svgUrl={svgProfile} />\n                    <ToggleItem name={'Диалоги'} svgUrl={svgDialogs} link={browserRouteHome}/>\n                    <ToggleItem name={'Контакты'} svgUrl={svgContact} />\n                    <ToggleItem name={'Выйти'} svgUrl={svgExit} onClick={() => store.logout()} />\n                </div>\n            )}\n        </div>\n    );\n}\n\nexport default Toggle;"],"mappings":"8IAAA,MAAOA,MAAK,KAAM,OAAO,CACzB,OAAQC,UAAU,KAAO,UAAU,CACnC,OAAQC,UAAU,CAAEC,UAAU,CAAEC,UAAU,CAAEC,OAAO,CAAEC,OAAO,KAAO,cAAc,CACjF,OAAQC,OAAO,KAAO,aAAa,CACnC,OAAQC,gBAAgB,KAAO,cAAc,CAC7C,MAAOC,WAAU,KAAM,YAAY,CACnC,MAAO,eAAe,CAAC,wFAEvB,GAAMC,OAAM,CAAG,QAATA,OAAM,EAAS,CACjB,sBAAgBV,KAAK,CAACW,UAAU,CAACJ,OAAO,CAAC,CAAlCK,KAAK,mBAALA,KAAK,CACZ,oBAA4BZ,KAAK,CAACa,QAAQ,CAAU,KAAK,CAAC,oDAAnDC,MAAM,qBAAEC,SAAS,qBAExB,mBACI,aAAK,SAAS,CAAC,iBAAiB,wBAC5B,eAAQ,SAAS,CAAEN,UAAU,CAAC,yBAAyB,CACnD,CAAC,iCAAiC,CAAEK,MAAM,CAAC,CAAE,CACzC,OAAO,CAAE,yBAAMC,UAAS,CAAC,CAACD,MAAM,CAAC,EAAC,CAClC,KAAK,CAAE,CAACE,e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